<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
    test(() => assert_selection(
        [
            '<div contenteditable>',
                '<ul type="none">',
                    '<li>one</li>',
                    '<li>two</li>',
                    '<li>|three</li>',
                    '<li>four</li>',
                    '<li>five</li>',
                '</ul>',
            '</div>',
        ].join(''),
        selection => {
            for (var counter = 0; counter < 5; ++counter)
                selection.document.execCommand('delete');
        },
        [
            '<div contenteditable>',
                '<ul type="none">',
                    '<li>one|three</li>',
                    '<li>four</li>',
                    '<li>five</li>',
                '</ul>',
            '</div>',
        ].join('')),
        'Delete contents of list item to merge list items');

    test(() => assert_selection(
        [
            '<div contenteditable>',
                '<ul type="none">',
                    '<li>one</li>',
                    '<li>two</li>',
                    '<li>three|</li>',
                    '<li>four</li>',
                    '<li>five</li>',
                '</ul>',
            '</div>',
        ].join(''),
        selection => {
            for (var counter = 0; counter < 5; ++counter)
                selection.document.execCommand('delete');
        },
        [
            '<div contenteditable>',
                '<ul type="none">',
                    '<li>one</li>',
                    '<li>two</li>',
                    '<li>|<br></li>',
                    '<li>four</li>',
                    '<li>five</li>',
                '</ul>',
            '</div>',
        ].join('')),
        'Delete contents of list item to insert placeholder');
</script>
